| Conditions | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | class Queue1 { |
||
| 7 | enqueue(record) { |
||
| 8 | // - Pop out all elements from Stack1, push to Stack2 |
||
| 9 | while (this.stack1.top()) { |
||
| 10 | this.stack2.push(this.stack1.pop()); |
||
| 11 | } |
||
| 12 | // - Push new record to Stack1 |
||
| 13 | this.stack1.push(record); |
||
| 14 | // - Pop out all elements from Stack2, push back to Stack1 |
||
| 15 | while (this.stack2.top()) { |
||
| 16 | this.stack1.push(this.stack2.pop()); |
||
| 17 | } |
||
| 18 | } |
||
| 19 | dequeue() { |
||
| 59 |